function changePeople(newPeople) {
    var returnPeople = { name: 'white', age: 18 };
    if (newPeople.name) {
        returnPeople.name = newPeople.name;
    }
    if (newPeople.age) {
        returnPeople.age = newPeople.age;
    }
    console.log(returnPeople);
    return returnPeople;
}
changePeople({ name: 'bob', age: 34 });
function getAnimal(newAnimal) {
    var animal1 = { name: 'cat', age: 2, color: 'red' };
    if (newAnimal.name) {
        animal1.name = newAnimal.name;
    }
    newAnimal.age = newAnimal.age ? newAnimal.age : 0;
    console.log(animal1);
    return animal1;
}
var animal2 = { name: 'mon', color: 'x', age: 10 };
getAnimal(animal2);
// interface animal{
//     x: number,
//     y: number
// }
// @ts-ignore
// let p1:animal = {x: 2,y: 10}
// console.log(p1)
